<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>add_emp.jsp</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">

		<link rel="stylesheet" type="text/css" href="./css/style.css">
		<script language="javascript" type="text/javascript" src="./My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" src="./js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript">
			function checkdata(){
				var url = "./emp/EmpCheckAction";
				var value= $("#EId").val();
				if(value!=""&&value!=null){
					$.post(url,{EId:value}, function(data){
						
						if(data =="true"){
							$("#id_msg").html("*该用户 ID已存在");
							return data;
						}else{
							$("#id_msg").html("*该用户 ID有效 ");
							return data;
						}
					});
				}else{
					$("#id_msg").html("");
				}
			}
		</script>
	</head>


	<body>
		<div id="blue_button">
			<div id="blue_button_word">&nbsp;新增员工</div>
		</div>
		<div id="right_background">
		<form action="./emp/empAddAction" method="post" id="form"><br />
			<div align="center"><font id="id_msg" color="red"></font></div>
			<table cellpadding="10" cellspacing="10" border="0" align="center">
				<tr align="right">
					<td>员工编号:</td>
					<td><input type="text" id="EId" name="emp.EId" onblur="checkdata()" /></td>
					<td>员工姓名:</td>
					<td><input type="text" name="emp.EName" /></td>
				</tr>
				<tr align="right">
					<td>密&nbsp;&nbsp;&nbsp;&nbsp;码:</td>
					<td>
						<input type="text" name="emp.EPwd" />
					</td>
					<td>性&nbsp;&nbsp;&nbsp;&nbsp;别:</td>
					<td>
						<select style="width: 150px; font-color: darkblue;" name="emp.ESex">
							<option value="M">
								男
							</option>
							<option value="F">
								女
							</option>
						</select>
					</td>
					</tr>
					<tr align="right">
						<td>生&nbsp;&nbsp;&nbsp;&nbsp;日:</td>
						<td>
							<input type="text" name="emp.EBirthday" class="Wdate" onclick="WdatePicker()"/>
						</td>
						<td>邮&nbsp;&nbsp;&nbsp;&nbsp;箱:</td>
						<td><input type="text" name="emp.EEmail" /></td>
					</tr>
					<tr align="right">
						<td>所属部门:</td>
						<td>
							<select style="width: 150px; font-color: darkblue;"
								name="emp.EDeptno">
								<option id="" value="">
										-- 请选择 --
								</option>
								<c:forEach items="${dept}" var="d">
									<option id="" value="${d.deptno}">
										${d.dname}
									</option>
								</c:forEach>
							</select>
						</td>
						<td>工&nbsp;&nbsp;&nbsp;&nbsp;作:</td>
						<td><input type="text" name="emp.EJob" /></td>
					</tr>
					<tr align="right">
						<td>联系电话:</td>
						<td>
							<input type="text" name="emp.EPhone" />
						</td>
						<td>权&nbsp;&nbsp;&nbsp;&nbsp;限:</td>
						<td>
							<input type="text" name="emp.ERight" value="11100"
								readonly />
							<input type="hidden" name="emp.EStatus" value="Y" />
						</td>
					</tr>
					<tr>
						<td>员工简介:</td>
						<td colspan="3">
							<textarea name="emp.EDescribe" rows="3" cols="30" >${room.roomDescribe}</textarea>
						</td>
					</tr>
				</table>
				<div align="center">
					<input type="submit" class="add" value="提交" />&nbsp;&nbsp;
					<input type="reset" class="add" value="重置"/>&nbsp;&nbsp;
					<input type="button" class="add" value="返 回&gt;&gt;"
						onclick="location.href='../emp/empAction'" />
				</div>
				<div align="center"><font id="msg" color="red">${msg}</font></div>
			</form>
		</div>

	</body>
</html>
